import BaseApi from "./BaseApi";

const controller = "/homePage";

export default {

    parkingAreaDataStatistics(condition) {
        return this.requestPost(controller, "/parkingAreaDataStatistics", condition);
    },

    chargeStatistics(condition) {
        return this.requestPost(controller, "/chargeStatistics", condition);
    },

    parkingTimeStatistics(condition) {
        return this.requestPost(controller, "/parkingTimeStatistics", condition);
    },
    getParkingTrends(condition) {
        return this.requestPost(controller, "/getParkingTrends", condition);
    },

    saveParkingTimeSetting(condition) {
        return this.requestPostForJson(controller, "/saveParkingTimeSetting", condition);
    },

    findAllParkingTimeSetting(condition) {
        return this.requestPost(controller, "/findAllParkingTimeSetting", condition);
    },
    getTruckSpaceSurvey(condition) {
        return this.requestPost(controller, "/getTruckSpaceSurvey", condition);
    },
    staffOnDutySituation(condition) {
        return this.requestPost(controller, "/staffOnDutySituation", condition)
    },
    complainStatistics(condition) {
        return this.requestPost(controller, "/complainStatistics", condition);
    },

    //请求封装
    requestGet(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestGet(newUrl, condition);
    },
    requestPost(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPost(newUrl, condition);
    },
    requestPostForJson(controller, url, condition) {
        let newUrl = controller + url;
        return BaseApi.requestPostForJson(newUrl, condition);
    },
}